Repetier-Firmware  1.0.0
HAL.cpp File Reference
#include "Repetier.h"
#include <compat/twi.h>
#include <avr/io.h>

Macros

#define HEATER_PWM_STEP   2
 
#define HEATER_PWM_MASK   254
 
#define COOLER_PWM_SPEED   0
 
#define COOLER_PWM_STEP   1
 
#define COOLER_PWM_MASK   255
 
#define pulseDensityModulate(pin, density, error, invert)   {uint8_t carry;carry = error + (invert ? 255 - density : density); WRITE(pin, (carry < error)); error = carry;}
 
#define ADVANCE_DIR_FILTER_STEPS   2
 

Functions

long __attribute__ ((used)) stepperWait=0
 
void setTimer (uint32_t delay)
 Sets the timer 1 compare value to delay ticks. More...
 
 ISR (TIMER1_COMPA_vect)
 Timer interrupt routine to drive the stepper motors. More...
 
 ISR (PWM_TIMER_VECTOR)
 
 ISR (EXTRUDER_TIMER_VECTOR)
 Timer routine for extruder stepper. More...
 

Variables

uint8 osAnalogInputCounter [ANALOG_INPUTS]
 
uint osAnalogInputBuildup [ANALOG_INPUTS]
 
uint8 osAnalogInputPos = 0
 
const uint16_t fast_div_lut [17] PROGMEM
 
void(* resetFunc )(void)=0
 
static int8_t extruderLastDirection = 0
 

Macro Definition Documentation

◆ ADVANCE_DIR_FILTER_STEPS

#define ADVANCE_DIR_FILTER_STEPS   2

◆ COOLER_PWM_MASK

#define COOLER_PWM_MASK   255

◆ COOLER_PWM_SPEED

#define COOLER_PWM_SPEED   0

◆ COOLER_PWM_STEP

#define COOLER_PWM_STEP   1

◆ HEATER_PWM_MASK

#define HEATER_PWM_MASK   254

◆ HEATER_PWM_STEP

#define HEATER_PWM_STEP   2

◆ pulseDensityModulate

#define pulseDensityModulate (   pin,
  density,
  error,
  invert 
)    {uint8_t carry;carry = error + (invert ? 255 - density : density); WRITE(pin, (carry < error)); error = carry;}

Function Documentation

◆ __attribute__()

long __attribute__ ( (used)  )
pure virtual

◆ ISR() [1/3]

ISR ( TIMER1_COMPA_vect  )

Timer interrupt routine to drive the stepper motors.

◆ ISR() [2/3]

ISR ( PWM_TIMER_VECTOR  )

This timer is called 3906 timer per second. It is used to update pwm values for heater and some other frequent jobs.

◆ ISR() [3/3]

Timer routine for extruder stepper.

Several methods need to move the extruder. To get a optima result, all methods update the printer_state.extruderStepsNeeded with the number of additional steps needed. During this interrupt, one step is executed. This will keep the extruder moving, until the total wanted movement is achieved. This will be done with the maximum allowable speed for the extruder.

◆ setTimer()

void setTimer ( uint32_t  delay)
inline

Sets the timer 1 compare value to delay ticks.

This function sets the OCR1A compare counter to get the next interrupt at delay ticks measured from the last interrupt. delay must be << 2^24

Variable Documentation

◆ extruderLastDirection

int8_t extruderLastDirection = 0
static

◆ osAnalogInputBuildup

uint osAnalogInputBuildup[ANALOG_INPUTS]

◆ osAnalogInputCounter

uint8 osAnalogInputCounter[ANALOG_INPUTS]

◆ osAnalogInputPos

uint8 osAnalogInputPos = 0

◆ PROGMEM

const uint16_t slow_div_lut [257] PROGMEM
Initial value:
= {0,F_CPU/4096,F_CPU/8192,F_CPU/12288,F_CPU/16384,F_CPU/20480,F_CPU/24576,F_CPU/28672,F_CPU/32768,F_CPU/36864
,F_CPU/40960,F_CPU/45056,F_CPU/49152,F_CPU/53248,F_CPU/57344,F_CPU/61440,F_CPU/65536
}

◆ resetFunc

void(* resetFunc) (void)=0